local skel = fk.CreateSkill {
  name = "emo__lianpian",
}

skel:addEffect("active", {
  anim_type = "drawcard",
  times = function (self, player)
    return 1 - player:usedSkillTimes(skel.name, Player.HistoryPhase)
  end,
  can_use = function(self, player)
    return player:usedSkillTimes(skel.name, Player.HistoryPhase) == 0
  end,
  card_num = 0,
  target_num = 0,
  prompt = "#emo__lianpian-prompt",
  on_use = function(self, room, effect)
    local player = effect.from
    local get = {}
    for _, pattern in ipairs({"spade,club","heart,diamond"}) do
      local cards = room:getCardsFromPileByRule(".|.|"..pattern)
      if #cards > 0 then
        table.insert(get, cards[1])
      end
    end
    room:moveCardTo(get, Card.PlayerHand, player, fk.ReasonJustMove, skel.name)
    room:setPlayerMark(player, "emo__zhanwu_mode", player:getMark("emo__zhanwu_mode") == 0 and 1 or 0)
  end,
})

skel:addEffect("prohibit", {
  is_prohibited = function(self, from, to, card)
    return to:hasSkill(skel.name) and (card:isVirtual() or card.name ~= Fk:getCardById(card.id, true).name) and #Card:getIdList(card) > 0
  end,
})

Fk:loadTranslationTable{
  ["emo__lianpian"] = "连翩",
  [":emo__lianpian"] = "出牌阶段限一次，你可以摸红色和黑色各一张牌，并切换〖战舞〗描述中的“基本牌”和“非基本牌”。你无法成为转化牌的目标。",
  ["#emo__lianpian-prompt"] = "连翩：摸红色和黑色各一张牌，然后修改〖战舞〗",
}

return skel
